//============================================================================
// Name        : TpDatos.cpp
// Author      : Lucio Altamirano
// Version     :
// Copyright   : 
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include "Parser.h"
#include <string>
#include "ExtractorDePaths.h"
#include <list>
using namespace std;

void indexar(string raiz) {
	Parser* miParser = new Parser(raiz);

	//extraigo todos los path de los documentos que estan en el path raiz
	ExtractorDePaths *extractorDePaths = new ExtractorDePaths();

	list<string>* paths = extractorDePaths->verArchivos(raiz);
	list<string>::iterator it;

	cout << paths->size()  << " documentos"<< endl;
	int i = 0;

	for(it=paths->begin(); it!=paths->end();it++, i++){
		cout <<  i << " " << *it << endl;
		miParser->parsear(*it);
	}
	delete extractorDePaths;
}

int main() {

	string argumento = "/home/lucio/texto/";

	cout << "- Indexar: " << argumento << endl;
	indexar(argumento);

	cout << "Termino" << endl;

	return 0;
}
